what's the difference between function and method